import request from 'axios'

const api_name = '/admin/system/book'

export default {

  /*
  获取角色分页列表(带搜索)
  */
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  },
  save(role) {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: role
    })
  },
  //编辑
getById(id) {
  return request({
    url: `${api_name}/get/${id}`,
    method: 'get'
  })
},
//更新
updateById(role) {
  return request({
    url: `${api_name}/update`,
    method: 'put',
    data: role
  })
},
batchRemove(idList) {
  return request({
    url: `${api_name}/batchRemove`,
    method: `delete`,
    data: idList
  })
}
}